#include "SelectorImpl.h"

CharacterDataSelectorImpl::CharacterDataSelectorImpl()
{
}

CharacterDataSelectorImpl::CharacterDataSelectorImpl(const string& _data)
	:data(_data)
{

}

CharacterDataSelectorImpl::~CharacterDataSelectorImpl()
{

}

Selector::SelectorType CharacterDataSelectorImpl::getSelectorType()const
{
	return Selector::SAC_CDATA_SECTION_NODE_SELECTOR;
}

Selector* CharacterDataSelectorImpl::Copy()const
{
	return new CharacterDataSelectorImpl(data);
}

const string* CharacterDataSelectorImpl::toString()const
{
	string* result = NULL;
	try
	{
		result = new string(data);
	}catch(std::exception& e)
	{
		if(result)
			delete result;
		return NULL;
	}
	return result;
}

const string& CharacterDataSelectorImpl::getData()const
{
	return data;
}

